package cosc617_blackteam;

/**
 * Creates a comment and stores it in the information aggregator
 * @author Laura
 */
public class CmdCreateComment implements I_Command {

    private I_InfoAggregator infoAggr;
    Comment comment;

    public CmdCreateComment(I_InfoAggregator infoAggr, String name, String text) {
        this.infoAggr = infoAggr;
        comment = new Comment(name, text);
    }

    /*
     * @return null
     */
    @Override
    public Object execute() {
      
        this.infoAggr.addComment(comment);
        return null;
    }
}
